package Installer::Command::TruncateFiles;

use JIP::ToolSet; # load my commonly-used modules in a single import
use parent qw( Build::Command );

use Taxonomy qw( getAllTaxonomies contentTypeToTableName );

sub execute {
    my $self = shift;

    $self->log->Note('executing "TruncateFiles" command...');

    foreach my $eachContentType ( getAllTaxonomies() ) {
        my $tableName = contentTypeToTableName( $eachContentType );

        $self->log->Note( "truncate '". $tableName ."' table" );

        $self->orm->storage->dbh->do( "TRUNCATE TABLE ". $tableName );
    }

    $self->log->Note('"TruncateFiles" finished');
}

1;
